package cn.yuanqiao.archive.appManager.mapper;

import cn.yuanqiao.archive.appManager.domain.TenantCategory;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 业务档案门类Mapper接口
 *
 * @author yuanqiao
 * @date 2023-06-14
 */
public interface TenantCategoryMapper {
    /**
     * 查询业务档案门类
     *
     * @param ID 业务档案门类主键
     * @return 业务档案门类
     */
    TenantCategory selectTenantCategoryByID(@Param("id") Long ID, @Param("tableName") String tableName);

    /**
     * 查询业务档案门类列表
     *
     * @param tenantCategory 业务档案门类
     * @return 业务档案门类集合
     */
    List<TenantCategory> selectTenantCategoryList(TenantCategory tenantCategory);

    String getAllFieldOfTable(String tableName);


    /**
     * 新增业务档案门类
     *
     * @param tenantCategory 业务档案门类
     * @return 结果
     */
    int insertTenantCategory(TenantCategory tenantCategory);

    /**
     * 修改业务档案门类
     *
     * @param tenantCategory 业务档案门类
     * @return 结果
     */
    int updateTenantCategory(TenantCategory tenantCategory);

    String selectGroupIdById(@Param("id") Long id, @Param("tableName") String tableName);

    int deleteYqdacategoryModelByIDs(@Param("IDs") Long[] IDs, @Param("tableName") String tableName);

    int createTable(@Param("tableName") String tableName, @Param("colNames") Map<String, String> colNames, @Param("type") Integer type);

    int createJCTables(@Param("tenantCode") String tenantCode, @Param("tableName") String tableName);

    int updateMainTableCol(String updateMainTableSql);

    /**
     * 删除业务档案门类
     *
     * @param ID 业务档案门类主键
     * @return 结果
     */
    int deleteTenantCategoryByID(@Param("id") Long ID, @Param("tableName") String tableName);

    //int getNumberByTenantCode(@Param("tenantCode") String tenantCode,@Param("tableName") String tableName);

    int createCategoryTable(@Param("tableName") String tableName);

    void initCategory(List<TenantCategory> tenantCategory);

    TenantCategory categoryModelList(Long categoryId);

    List<TenantCategory> getcatebyfondsid(@Param("fondsid") Long fondsid, @Param("tableName") String tableName, @Param("tenantCode") String tenantCode);

    TenantCategory selectTenantCategoryByTableName(@Param("subTableName") String subTableName, @Param("tableName") String tableName);

    List<TenantCategory> selectTenantCategoryListIsUse(TenantCategory category);

    List<TenantCategory> getCategoryById(@Param("ids") String ids, @Param("tableName") String tableName);

    List<TenantCategory> getcatemodeltreeUse(@Param("tableName") String tableName);


    List<TenantCategory> listnopagehasgroup(TenantCategory tenantCategory);

    List<String> getdaidsbyrenwuid(@Param("renwuid") Long renwuid, @Param("tableName") String tableName);

    List<TenantCategory> selectNewTenantCategoryList(TenantCategory tenantCategory);

    List<TenantCategory> listnopagehasgrouphaspro(@Param("tableName")String tableName, @Param("secSql")String secSql);

    TenantCategory getCategoryByDaId(@Param("tableName") String tableName, @Param("fileTableName") String fileTableName, @Param("id")Long id);

    int updateFondsTenantCategory(@Param("fondsCode")String fondsCode,@Param("tableName") String tableName);

    public TenantCategory selectTenantCategoryBytableName(@Param("subTbleName") String subTbleName, @Param("tableName") String tableName, @Param("value") String value);

    List<TenantCategory> selectTenantCategoryListbytablename(@Param("tableName")String tableName);
}
